import { onMounted, onUnmounted, onActivated, onDeactivated } from "vue";

export function useBgReset() {
  let oldColor = "";
  let changeBodyBackground = () => {
    oldColor = document.body.style.backgroundColor;
    document.body.style.backgroundColor = "var(--dx-color-white-mute)";
  };

  let recoverBodyBackground = () => {
    document.body.style.backgroundColor = oldColor;
  };

  onMounted(changeBodyBackground);
  onActivated(changeBodyBackground);
  onUnmounted(recoverBodyBackground);
  onDeactivated(recoverBodyBackground);
}
